<template>
	<view :style="themeColor">
		<view class="page">
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout login_flex_0">
				<view class='flex flex-wrap align-center justify-center login_fd0_0'>
					<image class='login_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
				</view>
				<view class='flex flex-wrap align-center login_fd0_1'>
					<image class='login_fd0_1_c0' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
					<input class='flex-sub login_fd0_1_c1' type="number" :placeholder="`请输入手机号`" confirm-type="done"
						:maxlength="11" placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="account" />
				</view>
				<view class='flex flex-wrap align-center login_fd0_2'>
					<image class='login_fd0_1_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
					<benben-flex-password-diy v-model="password" class-name="flex flex align-center login_fd0_2_c1"
						:placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx">
						<template #show>
							<text class='fu-iconfont2  login_fd0_2_c1_icon1' data-type="show">&#xE837;</text>
						</template>
						<template #hide>
							<text class='fu-iconfont2  login_fd0_2_c1_icon1' data-type="hide">&#xEBCC;</text>
						</template>
					</benben-flex-password-diy>
				</view>
				<view class='flex flex-direction-row-reverse flex-wrap align-center login_fd0_3'>
					<text class='login_fd0_3_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/dlzc/verificationLogin/verificationLogin`">验证码登录</text>
				</view>
				<button class='login_fd0_4' @tap.stop="onlogonFunc()">登录</button>
				<view class='flex flex-wrap align-center justify-center login_fd0_3'>
					<text class='login_fd0_5_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/dlzc/register/register`">注册账号</text>

					<view class='flex  login_fd0_5_c1'></view>

					<text class='login_fd0_5_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/dlzc/forgetPasswords/forgetPasswords`">忘记密码</text>
				</view>
				<!-- <view class='flex flex-wrap align-center justify-center login_fd0_6'>

					<view class='flex  login_fd0_6_c0'></view>

					<text class='login_fd0_6_c1'>快捷登录</text>

					<view class='flex  login_fd0_6_c0'></view>

				</view> -->
				<!-- <view class='flex flex-wrap align-center justify-center login_fd0_3'>
					<image class='login_fd0_7_c0' mode="aspectFit" :src='STATIC_URL+"4.png"'></image>
				</view> -->
				<view class='flex flex-wrap align-center justify-center login_fd0_8'>
					<benben-flex-switch-new class-name='flex flex' v-model="id_tk" :disabled='false'>
						<template v-slot:checked>

							<view class='flex flex position-relative align-center'>
								<image class='login_checkfd0_8_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"8.png"'>
								</image>
							</view>

						</template>
						<template v-slot:unchecked>

							<view class='flex flex position-relative justify-end align-center'>
								<image class='login_noCheckfd0_8_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"6.png"'>
								</image>
							</view>

						</template>
					</benben-flex-switch-new>
					<text class='login_fd0_8_c1'>已阅读并同意</text>
					<text class='login_fd0_8_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/dlzc/agreements/agreements`">《用户注册协议》</text>
					<text class='login_fd0_8_c3'>与</text>
					<text class='login_fd0_8_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/dlzc/privacyPolicy/privacyPolicy`">《隐私政策》</text>
				</view>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"id_tk": false,
				"dataList": {
					"userinfo": {
						"user_token": "",
						"id": "",
						"avatar": "",
						"real_name": "",
						"nickname": "",
						"email": "",
						"gender": "",
						"mobile": "",
						"birthday": "",
						"client_id": "",
						"phone": ""
					}
				},
				"password": "",
				"account": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//登录
			async onlogonFunc() {
				if (this.id_tk === false) {
					this.$message.info('请勾选用户协议');
					return false;
				}
				//因无接口，暂时做跳转首页
				if (!validate(this.account, 'require')) {
					this.$message.info('请输入手机号');
					return false;
				}
				if (!validate(this.account, 'phone')) {
					this.$message.info('请输入正确的手机号');
					return false;
				}
				if (!validate(this.password, 'require')) {
					this.$message.info('请输入密码');
					return false;
				}
				if (!validate(this.password, 'password')) {
					this.$message.info('请输入正确的密码');
					return false;
				}
				if (this.id_tk === false) {
					this.$message.info('请勾选协议');
					return false;
				}
				//请求方法
				//数据验证

				let datadataList = await this.$api.post('/m6752/5c78dbfd977cf', {
					account: this.account,
					account_type: 'mobile',
					password: this.password
				});

				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data
				this.$store.commit('saveToken', this.dataList.userinfo.user_token)
				this.$store.commit('updateUserInfo', this.dataList.userinfo)
				uni.switchTab({
					url:'/pages/tabBar/home/home'
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: var(--benbenbgColor1);
		background-size: 100% auto;
	}

	.login_flex_0 {
		padding: 0rpx 56rpx 0rpx 56rpx;
	}

	.login_fd0_8_c3 {
		color: var(--benbenFontColor2);
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.login_fd0_8_c2 {
		color: rgba(252, 95, 128, 1);
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.login_fd0_8_c1 {
		color: rgba(153, 153, 153, 1);
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.login_noCheckfd0_8_c0_c1_c0 {
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		width: 32rpx;
		height: 32rpx;
	}

	.login_checkfd0_8_c0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
	}

	.login_fd0_8 {
		position: fixed;
		bottom: calc(29rpx + var(--window-bottom));
		left: 0rpx;
		width: 750rpx;
	}

	.login_fd0_7_c0 {
		width: 74rpx;
		height: 74rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_6_c1 {
		color: rgba(204, 204, 204, 1);
		font-size: 24rpx;
		font-weight: 400;
		line-height: 37rpx;
		margin: 0rpx 10rpx 0rpx 10rpx;
	}

	.login_fd0_6_c0 {
		background: #EEEEEE;
		width: 44rpx;
		height: 1rpx;
		margin: 10rpx 0rpx 10rpx 0rpx;
		transform: scaleY(0.5);
		border-radius: 1rpx 1rpx 1rpx 1rpx;
	}

	.login_fd0_6 {
		margin: 120rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_5_c1 {
		background: rgba(153, 153, 153, 1);
		width: 1rpx;
		height: 20rpx;
		margin: 0rpx 40rpx 0rpx 40rpx;
		transform: scaleX(0.5);
	}

	.login_fd0_5_c0 {
		color: rgba(153, 153, 153, 1);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.login_fd0_4 {
		background: #FC5F80;
		border-radius: 60rpx 60rpx 60rpx 60rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		width: 638rpx;
		height: 88rpx;
		line-height: 88rpx;
		margin: 48rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_3_c0 {
		color: var(--benbenFontColor0);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.login_fd0_3 {
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_2_c1_icon1 {
		width: 44rpx;
		line-height: 44rpx;
		text-align: center;
		font-size: 40rpx;
	}

	::v-deep .login_fd0_2_c1 {
		font-size: 32rpx;
		margin: 0rpx 0rpx 0rpx 28rpx;
		line-height: 40rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		width: 569rpx;
	}

	.login_fd0_2 {
		border-bottom: 1px solid #eee;
		background: var(--benbenbgColor1);
		padding: 40rpx 0rpx 40rpx 0rpx;
	}

	.login_fd0_1_c1 {
		color: var(--benbenFontColor0);
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx 0rpx 0rpx 28rpx;
	}

	.login_fd0_1_c0 {
		width: 34rpx;
		height: 34rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_1 {
		border-bottom: 1px solid #eee;
		background: var(--benbenbgColor1);
		padding: 40rpx 0rpx 40rpx 0rpx;
		margin: 80rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_0_c0 {
		width: 180rpx;
		height: 180rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.login_fd0_0 {
		margin: 150rpx 0rpx 0rpx 0rpx;
	}
</style>